from flask import Flask, abort ,request

app = Flask(__name__)
@app.route('/')
def index():
    name = request.args.get('name')
    if name == 'aaa':
        abort(404, "YOU can't access")

    return 'index'

if __name__ == '__main__':
    app.run(debug=True)